package com.web.exiaodao.business.entity;

import com.web.webstart.base.entity.BaseEntity;
import com.web.webstart.base.util.XaUtil;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 
* @ClassName: sysArea 
* @Description: 城市区域定义表
* @author eason
* @date 2017-01-12 16:16:52
*
 */
@Entity
@Table(name = "tb_xa_sysarea")
@ApiModel(value="城市区域定义表")
public class SysArea extends BaseEntity{

	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value="区域名称,AreaName")
	private String areaName;
	@ApiModelProperty(value="区域类型,areaType（1:区域(国内0，国外1) 2:具体的城市）")
	private Integer areaType;
	@ApiModelProperty(value="父资源id,父资源id")
	private Long parentId;
	@ApiModelProperty(value="排序id,排序id")
	private Long orderNum;
	@ApiModelProperty(value="首字母,Letter")
	private String letter;
	@ApiModelProperty(value="是否热点城市,是否热点城市")
	private Boolean isHot;

	public static final long SORT_DEFAULT = 9999999L;
		
	
	public void setAreaName(String areaName){
		this.areaName=areaName;
	}
	
	@Column(nullable=true,length=50)
	public String getAreaName(){
		return areaName;
	}
	public void setAreaType(Integer areaType){
		this.areaType=areaType;
	}
	
	@Column(nullable=true,length=50)
	public Integer getAreaType(){
		return areaType;
	}
	public void setParentId(Long parentId){
		this.parentId=parentId;
	}
	
	@Column(nullable=true,length=50)
	public Long getParentId(){
		return parentId;
	}
	public void setOrderNum(Long orderNum){
		this.orderNum=orderNum;
	}
	
	@Column(nullable=true,length=50)
	public Long getOrderNum(){
		return orderNum;
	}
	public void setLetter(String letter){
		this.letter=letter;
	}
	
	@Column(nullable=true,length=50)
	public String getLetter(){
		return letter;
	}
	public void setIsHot(Boolean isHot){
		this.isHot=isHot;
	}
	
	@Column(nullable=true,length=50)
	public Boolean getIsHot(){
		return XaUtil.getBool(isHot);
	}

	@Override
	public void setInsertBefore() {
		super.setInsertBefore();
		if (orderNum == null) {
			orderNum = SORT_DEFAULT;
		}
	}
}
